﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WLive.WLiveObjects
{
    public class Error
    {
        public string error;
        public string error_description;
    }

    public class ErrorObj
    {
        public Error2 error;
    }
    public class Error2
    {
        public string code;
        public string message;
    }

    public class WLiveException : ApplicationException
    {
        public string Error { get { return err; } }
        public string ErrorDescription { get { return errdesc; } }
        string err, errdesc;
        public WLiveException(string error, string error_description) : base(error_description)
        {
            err = error;
            errdesc = error_description;
        }
        public WLiveException(Error error) : base(error.error_description)
        {
            err = error.error;
            errdesc = error.error_description;
        }
        public WLiveException(ErrorObj error) : base(error.error.message)
        {
            err = error.error.code;
            errdesc = error.error.message;
        }
    }
}
